home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13363 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: news.sinet.slb.com!usenet
  2. From: primaves@manchester.gm.slb.com (Nick Primavesi)
  3. Newsgroups: comp.lang.basic.visual.misc,comp.lang.c,comp.lang.c++
  4. Subject: Re: DLL, VB and Borland C/C++
  5. Date: Mon, 25 Mar 1996 09:52:01 GMT
  6. Organization: Schlumberger
  7. Message-ID: <4j5mqr$su7@ohnasn01.sinet.slb.com>
  8. References: <312A0334.AC5@supaero.fr> <4gfg6m$eet@hasle.sn.no> <4hagmf$qc0@donald.interpac.be>
  9. NNTP-Posting-Host: 134.32.42.14
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. tlgnsmd@mail.interpac.be (Michel Lombart) wrote:
  13.  
  14. >Sylvain Souche <souche@supaero.fr> wrote
  15.  
  16. >>Hi,
  17.  
  18. >>I am trying desperatly to call a DLL created with Borland C/C++ 4.5 in a 
  19. >>VB 3.0 application, but VB always complains about a so called "Bad 
  20. >>Calling Convention Error". This Error message is not very documented, 
  21. >>and Borland Help files are worth nothing, so...
  22.  
  23. > Hi Sylvain.
  24.  
  25. >Did you use, if necessary,  the "byval" option in your declaration
  26. >code?
  27.  
  28. >Michel
  29.  
  30. I have the same problem with VB4.0 and Visual C++ DLLs
  31.  
  32. The ByVal option is required but this does not always cure the
  33. problem.
  34.  
  35. VB uses the PASCAL calling convention so the DLL should be compiled
  36. using FAR PASCAL for 16 bit or __stdcall. This still did not cure my
  37. problem but it got me closer.
  38.  
  39. I have just been infomed that my problem is due to the omission of the
  40. .DEF file by the VC++ compiler now so check that you also have the
  41. DEF file with the .DLL.
  42.  
  43. Let me know if this helps and if you discover anything that may help
  44. me.
  45.  
  46. Cheers,
  47.  
  48. Jolyon.
  49.  
  50.